package com.example.demo.service;

import com.example.demo.mapper.TeacherMapper;
import com.example.demo.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService{
    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public List<Teacher> queryTeacher() {
        return teacherMapper.queryTeacher();
    }

    @Override
    public void addTeacher(String teacher_name, int teacher_number, String teacher_sex, int teacher_age) {
        teacherMapper.addTeacher(teacher_name,teacher_number,teacher_sex,teacher_age);
    }

    @Override
    public void updateTeacher(Teacher teacher) {
        teacherMapper.updateTeacher(teacher);
    }

    @Override
    public void deleteTeacher(int id) {
        teacherMapper.deleteTeacher(id);
    }
}
